home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Controls
/
Visual Basic Controls.iso
/
vbcontrol
/
regicon
/
reginf5.frm
< prev
next >
Wrap
Text File
|
1997-12-11
|
9KB
|
260 lines
VERSION 5.00
Object = "{6B1BE80A-567F-11D1-B652-0060976C699F}#1.0#0"; "Regicon.ocx"
Begin VB.Form Form1
BackColor = &H00C0C0C0&
Caption = "Regicon Browser Settings"
ClientHeight = 1935
ClientLeft = 1500
ClientTop = 3585
ClientWidth = 8895
Icon = "reginf5.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
PaletteMode = 1 'UseZOrder
ScaleHeight = 1935
ScaleWidth = 8895
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton cmdSteps
Caption = "&See the Code"
Height = 375
Left = 7320
TabIndex = 2
Top = 600
Width = 1455
End
Begin VB.CommandButton cmdClose
Caption = "&Close"
Height = 375
Left = 7320
TabIndex = 1
Top = 240
Width = 1455
End
Begin VB.Frame Frame1
Height = 1695
Left = 120
TabIndex = 0
Top = 120
Width = 6975
Begin VB.CommandButton cmdReset
Caption = "&Reset Start Page"
Height = 375
Left = 5160
TabIndex = 10
Top = 1200
Width = 1695
End
Begin VB.CommandButton cmdApply
Caption = "&Change Start Page"
Height = 375
Left = 5160
TabIndex = 9
Top = 840
Width = 1695
End
Begin VB.ComboBox cboStartPages
Height = 315
Left = 1680
TabIndex = 3
Top = 840
Width = 3375
End
Begin RegistryControl.RegiCon RegiCon1
Left = 120
Top = 840
_ExtentX = 847
_ExtentY = 847
End
Begin VB.Label lblDefaultBrowser
Height = 255
Left = 1680
TabIndex = 8
Top = 240
Width = 3375
End
Begin VB.Label Label2
Alignment = 1 'Right Justify
Caption = "Deafult Browser:"
Height = 255
Left = 120
TabIndex = 7
Top = 240
Width = 1455
End
Begin VB.Label Label3
Alignment = 1 'Right Justify
Caption = "Current Start Page:"
Height = 255
Left = 120
TabIndex = 6
Top = 480
Width = 1455
End
Begin VB.Label lblStartPage
Height = 255
Left = 1680
TabIndex = 5
Top = 480
Width = 3375
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
Caption = "Start Pages:"
Height = 255
Left = 600
TabIndex = 4
Top = 840
Width = 975
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private DefaultBrowser As String
Private DefaultStartPage As String
Private NewStartPage As String
Private fDirty As Boolean
Private Sub cmdApply_Click()
Dim i As Integer
Dim fMatch As Boolean
If MsgBox("Change start page from " & vbCrLf & NewStartPage & vbCrLf & "to" & vbCrLf & cboStartPages.Text & "?", vbQuestion + vbYesNo, "Confirm Change?") = vbNo Then
Exit Sub
End If
NewStartPage = cboStartPages.Text
fDirty = True
If InStr(1, lblDefaultBrowser.Caption, "IExplore", 1) > 0 Then
'IE
RegiCon1.RootKey = rkHKEY_CURRENT_USER
RegiCon1.Key = "Software\Microsoft\Internet Explorer\Main"
RegiCon1.KeyItemName = "Start Page"
RegiCon1.KeyItemType = dtREG_SZ
RegiCon1.KeyItemValue = NewStartPage
RegiCon1.SetEntry
ElseIf InStr(1, lblDefaultBrowser.Caption, "Netscape", 1) > 0 Then
'Netscape
RegiCon1.RootKey = rkHKEY_CURRENT_USER
RegiCon1.Key = "Software\Netscape\Netscape Navigator\Main"
RegiCon1.KeyItemName = "Home Page"
RegiCon1.KeyItemType = dtREG_SZ
RegiCon1.KeyItemValue = NewStartPage
RegiCon1.SetEntry
End If
lblStartPage.Caption = NewStartPage
For i = 0 To cboStartPages.ListCount - 1
If StrComp(NewStartPage, cboStartPages.List(i), 1) = 0 Then
fMatch = True
Exit For
End If
Next i
If fMatch = False Then
cboStartPages.AddItem NewStartPage, 0
End If
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdReset_Click()
If InStr(1, lblDefaultBrowser.Caption, "IExplore", 1) > 0 Then
'IE
RegiCon1.RootKey = rkHKEY_CURRENT_USER
RegiCon1.Key = "Software\Microsoft\Internet Explorer\Main"
RegiCon1.KeyItemName = "Start Page"
RegiCon1.KeyItemType = dtREG_SZ
RegiCon1.KeyItemValue = DefaultStartPage
RegiCon1.SetEntry
ElseIf InStr(1, lblDefaultBrowser.Caption, "Netscape", 1) > 0 Then
'Netscape
RegiCon1.RootKey = rkHKEY_CURRENT_USER
RegiCon1.Key = "Software\Netscape\Netscape Navigator\Main"
RegiCon1.KeyItemName = "Home Page"
RegiCon1.KeyItemType = dtREG_SZ
RegiCon1.KeyItemValue = DefaultStartPage
RegiCon1.SetEntry
End If
lblStartPage.Caption = DefaultStartPage
cboStartPages.ListIndex = 0
NewStartPage = DefaultStartPage
fDirty = False
End Sub
Private Sub cmdSteps_Click()
frmCode.Show 1
End Sub
Private Sub Form_Load()
'verify there is a default browser entry
RegiCon1.RootKey = rkHKEY_LOCAL_MACHINE
RegiCon1.Key = "SOFTWARE\Classes\http\shell\open\ddeexec\Application"
RegiCon1.KeyItemName = ""
If RegiCon1.IsEntry = False Then
'
'no default browser installed, disable change start page options
cboStartPages.Enabled = False
cmdApply.Enabled = False
cmdReset.Enabled = False
Exit Sub
End If
'get the default browser
RegiCon1.GetEntry
'
'Display the entry
lblDefaultBrowser.Caption = RegiCon1.KeyItemValue
If InStr(1, lblDefaultBrowser.Caption, "IExplore", 1) > 0 Then
'Default is Internet Explorer
RegiCon1.RootKey = rkHKEY_CURRENT_USER
RegiCon1.Key = "Software\Microsoft\Internet Explorer\Main"
RegiCon1.KeyItemName = "Start Page"
RegiCon1.GetEntry
DefaultStartPage = RegiCon1.KeyItemValue
ElseIf InStr(1, lblDefaultBrowser.Caption, "Netscape", 1) > 0 Then
'Default is Netscape
RegiCon1.RootKey = rkHKEY_CURRENT_USER
RegiCon1.Key = "Software\Netscape\Netscape Navigator\Main"
RegiCon1.KeyItemName = "Home Page"
RegiCon1.GetEntry
DefaultStartPage = RegiCon1.KeyItemValue
Else
'unknown default browser, disable change start page options
cboStartPages.Enabled = False
cmdApply.Enabled = False
cmdReset.Enabled = False
Exit Sub
End If
'
'load the StartPage box with a list of URLs
NewStartPage = DefaultStartPage
lblStartPage.Caption = NewStartPage
cboStartPages.AddItem NewStartPage
cboStartPages.AddItem "http://www.mabry.com/index.htm"
cboStartPages.AddItem "http://www.microsoft.com/index.htm"
cboStartPages.AddItem "http://www.netscape.com/index.html"
c